﻿// =================================================================== 
// 项目说明
//====================================================================
// lsc @Copy Right 2019
// 文件： NetworkOrderAuditRepository.cs
// 项目名称：斑马车务
// 创建时间：2019/1/24
// 负责人：lsc
// ===================================================================
using System;
using System.Text;
using System.Collections.Generic;
using CGT.Infrastructure.Entity;
using CGT.Infrastructure.Dto;
using Dapper;
using System.Linq;

namespace CGT.Infrastructure.Repository
{
	/// <summary>
	///网办订单审核记录 仓储层
	/// </summary>	
	public class NetworkOrderAuditRepository:BaseRepository<NetworkOrderAudit>
	{		
    
        #region 构造

        public NetworkOrderAuditRepository() : base(){}

        public NetworkOrderAuditRepository(string connectionString) : base(connectionString){}

        public NetworkOrderAuditRepository(DatabaseContext dbContext) : base(dbContext){}

        #endregion

        /// <summary>
        /// 根据订单查询操作记录
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public List<NetworkOrderAuditDto> GetListByOrderId(long orderId)
        {
            string sql = "SELECT r.*,t.UserName FROM NetworkOrderAudit r with(nolock) inner join GovUser t with(nolock) on r.CreateUserID = t.UserID where r.OrderID=@OrderID";
            return dbContext.Connection.Query<NetworkOrderAuditDto>(sql, new { OrderID = orderId }).ToList();
        }
	}
}